import http from "@/http";
import {AssignParm, ListParm, LoginParm, SaveAssignParm, UpdateParm, User} from "./UserModel";
//新增
export const addAdminUserApi = (parm: User) => {
    return http.post("/api/sysUser", parm)
}
//列表
export const getListApi = (parm: ListParm) => {
    return http.get("/api/sysUser/getList", parm)
}
//编辑
export const editApi = (parm: User) => {
    return http.put("/api/sysUser", parm)
}
//删除
export const deleteApi = (userId: string) => {
    return http.delete(`/api/sysUser/${userId}`)
}
//登录
export const lgoinApi = (parm: LoginParm) => {
    return http.post("/api/sysUser/login", parm)
}
//获取树的数据
export const getAssignTreeApi = (parm: AssignParm) => {
    return http.get("/api/menu/getAssignTree", parm)
}
//保存分配的菜单
export const assigSaveApi= (parm:SaveAssignParm)=>{
    return http.post("/api/menu/assignSave",parm)
}
//修改密码
export const updatePasswordApi = (parm:UpdateParm)=>{
    return http.put("/api/sysUser/updatePassword",parm)
    }